package com.icode;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: my_code
 * @Email: my_code@foxmail.com
 * @Create: 2020-12-15 14:20
 */
public class Test {
    public static void main(String[] args) {
        List<?>[] lsa = new List<?>[10]; // OK, array of unbounded wildcard type.

        List<Integer> li = new ArrayList<>();
        List<String> li2 = new ArrayList<>();
        li.add(new Integer(3));
        li2.add("abc");
        lsa[2] = li2;
        lsa[1] = li; // Correct.
        Integer i = (Integer) lsa[1].get(0); // OK
        String str = (String) lsa[2].get(0);

        System.out.println(i+"   "+str);

    }

}
